<template>
  <div>父组件给我的值:{{ num }}</div>
  <a-button @click="toParent()">传给父组件</a-button>
</template>
<script lang="ts">
import { defineComponent } from "vue";

export default defineComponent({
  methods: {
    toParent() {
      this.$emit("toPas", "我是子组件");
    },
  },
  props: {
    num: {
      type: Number,
      default: 10,
    },
  },
  setup() {},
});
</script>
